
package com.backstage.web;

import com.backstage.pojo.dto.Message;
import com.backstage.pojo.entity.SysRole;
import com.backstage.pojo.vo.SysRoleVo;
import com.backstage.pojo.vo.SysUserVo;
import com.backstage.service.SysRoleService;
import com.backstage.service.SysUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SysRoleController {
    @Autowired
    SysRoleService sysRoleService;
    @GetMapping("/selectRoleList")
    public Message<List<SysRoleVo>> selectAllUser(SysRoleVo sysRoleVo){
        return sysRoleService.roleList(sysRoleVo);
    }
    @GetMapping("/updateRole")
    public Message<SysRoleVo> updateRole(SysRoleVo sysRoleVo){
        return sysRoleService.updateRole(sysRoleVo);
    }
    @GetMapping("/addRole")
    public Message<SysRoleVo> addRole(SysRoleVo sysRoleVo){
        return sysRoleService.addRole(sysRoleVo);
    }
    @GetMapping("/deleteRole")
    public Message<String> deleteRole(Long id){
        return sysRoleService.deleteRole(id);
    }
    @GetMapping("/deleteRoleList")
    public Message<String> deleteRoleList(List<Long> roles){
        return sysRoleService.deleteRoleList(roles);
    }

}
